home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / book / Chap06 / MATLIGHT / MATLIGHTVIEW.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-26  |  1.8 KB  |  69 lines

  1. // matlightView.h : interface of the CMatlightView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5. class CMatlightView : public CView
  6. {
  7. protected: // create from serialization only
  8.     CMatlightView();
  9.     DECLARE_DYNCREATE(CMatlightView)
  10.  
  11. // Attributes
  12. public:
  13.     CMatlightDoc* GetDocument();
  14.     BOOL m_bPrinting;
  15.  
  16.     CPalette m_GLPalette;    // Logical Palette
  17.     HDC m_hDC;
  18.  
  19. // OpenGL Attributes
  20.     HGLRC m_hRC;
  21.  
  22. // Operations
  23. public:
  24.  
  25. // Overrides
  26.     // ClassWizard generated virtual function overrides
  27.     //{{AFX_VIRTUAL(CMatlightView)
  28.     public:
  29.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  30.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  31.     virtual void OnInitialUpdate();
  32.     virtual BOOL DestroyWindow();
  33.     protected:
  34.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  35.     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  36.     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  37.     virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  38.     //}}AFX_VIRTUAL
  39.  
  40. // Implementation
  41. public:
  42.     virtual ~CMatlightView();
  43. #ifdef _DEBUG
  44.     virtual void AssertValid() const;
  45.     virtual void Dump(CDumpContext& dc) const;
  46. #endif
  47.  
  48. protected:
  49.     void PrintSettings(CDC* pDC);
  50.     void InitializePalette(HDC hDC);
  51.  
  52. // Generated message map functions
  53. protected:
  54.     //{{AFX_MSG(CMatlightView)
  55.     afx_msg void OnSize(UINT nType, int cx, int cy);
  56.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  57.     afx_msg BOOL OnQueryNewPalette();
  58.     afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
  59.     //}}AFX_MSG
  60.     DECLARE_MESSAGE_MAP()
  61. };
  62.  
  63. #ifndef _DEBUG  // debug version in matlightView.cpp
  64. inline CMatlightDoc* CMatlightView::GetDocument()
  65.    { return (CMatlightDoc*)m_pDocument; }
  66. #endif
  67.  
  68. /////////////////////////////////////////////////////////////////////////////
  69.